import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import vueJsx from '@vitejs/plugin-vue-jsx'
// const path = require('path')
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue({}), vueSetupExtend(), vueJsx()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  server: {
    host: 'www.corho.com',
    port: 8080,
    open: true,
    cors: true
  },
  // 配置css全局注入
  css: {
    preprocessorOptions: {
      less: {
        additionalData: `
        @import '@/assets/styles/variables.less';
        @import '@/assets/styles/mixins.less';
        `,
      }
    }
  }
})
